﻿#pragma once

typedef struct PictureCtrl PictureCtrl;

typedef void (*PictureCtrlDelete)(PictureCtrl*);
typedef void (*PictureCtrlGetPosition)(PictureCtrl*, POINT*);
typedef BOOL (*PicTRUECtrlIsOnOriginalPosition)(PictureCtrl*);
typedef void (*PicTRUECtrlSetBorder)(PictureCtrl*, BOOL);

// 图片控件
struct PictureCtrl {
    HWND mHandle;               // 窗口句柄
    BOOL mHasBorder;            // 有边框则为 TRUE，否则为 FALSE
    UINT mId;                   // id
    HBITMAP mImage;             // 图片
    HDC mImageDC;               // 图片保存者
    POINT mOriginalPosition;    // 原位置，即刚被创建时的初始位置
    int mSize;                  // 尺寸

    PictureCtrlDelete deleteSelf;
    PictureCtrlGetPosition getPosition;
    PicTRUECtrlIsOnOriginalPosition isOnOriginalPosition;
    PicTRUECtrlSetBorder setBorder;
};

PictureCtrl* New_PictureCtrl(BOOL, UINT, HDC, HWND, RECT);
